# -*-coding:utf-8-*-

MAIN_SERVICE_DEFAULT_PORT = 18600
DEPLOY_SERVICE_DEFAULT_PORT = 18601

MQ_HOST = 'localhost'
# MQ_USER = 'hifocus'
# MQ_PASS = '519070'
MQ_USER = None
MQ_PASS = None

MAX_SPECIFICS_LEN = 1024
# MQ_HTTP_GW_HOST = 'localhost:%d' % MAIN_SERVICE_DEFAULT_PORT
# MQ_HTTP_GW_HOST = 'gw0.iot.microembed.net'
# MQ_HTTP_GW_HOST = 'iot3.microembed.net'
MQ_HTTP_GW_HOST = 'localhost'

API_SIGN_TIMEOUT = 30
SMS_CODE_TIMEOUT = 60 * 30  # 30分钟有效
SMS_CODE_INTERVAL = 60 + 20  # 发送间隔不能超过60秒，20秒为传输耗时估值
TEST_API_SIGN_TIMEOUT = 3
TEST_SMS_CODE_TIMEOUT = 3

# APPKEY -> {'app_id': 'APP_ID', 'secret': 'SECRET'}
# algo:
# 1. md5.update(str(uuid.uuid4()))
# 2. md5.hexdigest().upper()

# TODO: 区分 debug 版与 release 版本
# 使用不同的域名
APPS = {
    'CA7E0BE302DF22F9CF4315BDCF66B62D': {
        'name': 'root',
        'desc': 'microembed',
        'app_id': '013A50065E93147B09245E657712A227',
        'secret': '720BFFF2C9C9627A4C36C119AB2361AA',

        'weixin': {
            # billy's wx mp no. `microembed`
            'mp': {
                'app_id': 'wx1ed17c5f860f88f6',
                'secret': '957c86a1e7389e2f868b6d3b12314999',
                'verify_token': 'iot2018',
            }
        },
        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能管家',
                'register_code': 'SMS_77775036',
                'reset_password_code': 'SMS_77765047',
                'change_phone_code': 'SMS_77630040',
            }
        },
        'use_alipay_sandbox': True,
        'alipay': {
            'appid': '',
            'rsa2': {
                'app_priv': '',
                'app_pub': '',
                'srv_pub': '',
            },
        },
        'alipay_sandbox': {
            'appid': '',
            'rsa2': {
                'app_pri': '',
                'app_pub': '',
                'srv_pub': '',
            },
        },
    },
    '403DB206089258FBB529B861AB768D59': {
        'name': '公众平台测试号',
        'desc': '公众平台号测试',
        'app_id': '12E4F3314D9E24718332FA45B6E704F1',
        'secret': '07BC866EC1149EC6BD54497C2143BDEA',
        'guest_enable': True,
        # guest_enable 设置为 True 时检查该字段是否存在
        # 不存在则随机创建
        'guest_id': '5b7a5302f3e0985613626f58', 
        'developer_id': '5ad8a81d97c2095144d9b298',


        'weixin': {
            # billy's test no
            'mp': {
                'app_id': 'wx83b0dfc9866ac48c',
                'secret': 'd8cf6396e8e50c25592529a75feadb16',
                'verify_token': 'iot2017',
            },
        },
        'use_alipay_sandbox': True,
        'alipay': {
            'appid': '2018081861041794',
            'mch_id': '2088112315985801',
            'rsa2': {
                'app_priv': 'MIIEowIBAAKCAQEArqDTHkiISP0AFQdPew6rlTIlM0h4Fwxu209DYxkyag6zB+wBwlHHeaWK07fv2+mlKSi3bxN3qdQImQ+W27Ba0zYRrffZTQUKdo48IiEUZKtfyXVCJAN7oBDnles+FhjVIXyLZ+z14duqU2PA5bVwhTODoyeE0tyGY62mIfDWemYb19zK6mlgyxI9A8saeOEfKaTRtj3OT7EJurFAlcZlY593Ci8WnAStBrP7CJSCRvB7xLYYprgT/QVtK+8+Vm5F9FMfAhg4wNoaePDzTIdOojRW8Qx8Qs+HDZWFvFzYxWZcertW1ocIiRkZ6sxs0vA/OyfiHZE/eJ2WzoSlraEvqQIDAQABAoIBAD86+Ha0qLRU95ylov/Z1gMVvyaMjP87f0BluO6/BuQkImsx54km92VyrYvvxCgKt8Tpe1H66I9TuTFC1csCVkC4CTrGzaX3t0wqQFfTRoEVFH/rt2E26aKRvGkqXra9kx6m7AtbX8TCNzAupIAIbI+ukXGYM53uP7MEA22yuNZkXUi4ZNlh/8wHPcq3HXM/DP5oCrIYinOBrpVYqp/cClBas334G1GzX1Le6sk7cJiauGGkvUE3nab71xcmVnApJtwyJJvk2pmxkyzcIUuaoH0JAP7hUCByLJugRiwrCrygWph26NRyByD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KtfyXVCJAN7oBDnles+FhjVIXyLZ+z14duqU2PA5bVwhTODoyeE0tyGY62mIfDWemYb19zK6mlgyxI9A8saeOEfKaTRtj3OT7EJurFAlcZlY593Ci8WnAStBrP7CJSCRvB7xLYYprgT/QVtK+8+Vm5F9FMfAhg4wNoaePDzTIdOojRW8Qx8Qs+HDZWFvFzYxWZcertW1ocIiRkZ6sxs0vA/OyfiHZE/eJ2WzoSlraEvqQIDAQAB',
                'srv_pub': 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0axTSkSIR7Bl/OmPQ8/kGky9+wznWxVIPuCmYb5TG4NVKxF3WQfdZWVkpa1fSRKbIeywd2LojaCQLVItnPYkqAGMcgDC13Yc4CKekcfeNV9eOtXQRxtvtTGss8ZrFmmJy5XtPjGbIJjt9D/bfauE/+dfQeqEUm6s6ymOv/xKM8PJztYwwLbjdTTOWEoEONFqgrdXVCUT0dYCH9Qbon7j9zXAiBQ5PUwTUpeLS5ZmmFX1MXaX3y6fOjn8CRZfkOfVEFNfKq0n4xSKIrpjb03Xv8knyG2pJE90pAsFET1PmkOv7j4BFFsZaMwEtk1U19UX/DKu5KNjTyhu7d55P2ohaQIDAQAB',
            },
        },
        'alipay_sandbox': {
            'appid': '2016091700535282',
            'mch_id': '2088102176093759',
            'rsa2': {
                'app_pri': 'MIIEogIBAAKCAQEAuTPdvG4PxqfqFyEBT8MeQqWXZYBhBj2Zbs0NGRgI9uk4NFzaAoAdziDbwKUxIZaDDl2KRqO8pE6i+R8UyUxb/w6A6D1ARthk8UT2aSQazVm4wHNqtJvtsjVjY3CpSuN8BKlf6L8Vyd1Wu/siVHGnMtwMOZwyRaSDfOMrtT58mIbd4gouxn7CYjepdLFQu1lGoKPDWwRq7+TD9AT35fMpBFGO8t2xnkdSdx771O93uqm9Q18p22kpDKC7zPfuDIUiCswvVSc1Uc8oARAWietHHXF5+VtATuX9NB42wSKrhDwSWem6MUhf68Nr/65nhUVoyVkD7SKos0HiZ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VRSOyAGIXd9nh2TmJJ/NgttuwqpDpvCYbpSBjD+rv8JZbLN6gRO/ibmreniubvwt2GG8FvtM/YHBz5BwZPIsthdTHJ7zuKoyZbItwaW1yuaCN813vkXY8gN442Gpzdp0Yv2eitDnmOP0QgSpgQ=',
                'app_pub': 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuTPdvG4PxqfqFyEBT8MeQqWXZYBhBj2Zbs0NGRgI9uk4NFzaAoAdziDbwKUxIZaDDl2KRqO8pE6i+R8UyUxb/w6A6D1ARthk8UT2aSQazVm4wHNqtJvtsjVjY3CpSuN8BKlf6L8Vyd1Wu/siVHGnMtwMOZwyRaSDfOMrtT58mIbd4gouxn7CYjepdLFQu1lGoKPDWwRq7+TD9AT35fMpBFGO8t2xnkdSdx771O93uqm9Q18p22kpDKC7zPfuDIUiCswvVSc1Uc8oARAWietHHXF5+VtATuX9NB42wSKrhDwSWem6MUhf68Nr/65nhUVoyVkD7SKos0HiZl23H35BawIDAQAB',
                'srv_pub': 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3gWO8tFBQeUMzQED9LUOQcRzRMhaivhqD2ksB+SczIz1gFNFkJ/rStv3O17mx5sWj1c9nnyBFcKWiRET52528nQFZkHXDJnaEurncH6rE2oO2DoDw/LaF/ouEnW5D8MI7mo0k6pTiA4pJP3qkpACN73UDcAr6b+io2snbzqxGrwDaW9haNMfwRxO61BnDyXc2dI2y4ku0HWFpxAYjhM3/noqxZOs5FgbJWYcc0QhyxVhCsBQYLha2yCJV9yfvTod4lKimTE4OR3613JlYm0l5YB9bdFkhalenIzkvjJYQFR+hKH4lk7pq3MaQFqnozFyx/f78nEZ4U0H5ysreNSrLQIDAQAB',
            },
        },

        'email': {
            # TODO: SMTP 配置
        },

        'ios': {
            # TODO: APNS 配置
        },
    },
    'ED1345ECD032D8D486502CB40A37736C': {
        'name': '[海富思智联开发]',
        'desc': '[海富思智联开发]',
        'app_id': 'BAA4E56280DA34E0C3697BEE37E1B04F',
        'secret': '23A5C489FDFF9F47438CA52613F650E3',
        'guest_enable': True,
        # guest_enable 设置为 True 时检查该字段是否存在
        # 不存在则随机创建
        'guest_id': '5b7a5302f3e0985613626f56', 
        'developer_id': '5ad8a81d97c2095144d9b283',

        'weixin': {
            'mp': {
                'app_id': 'wx4a3c00e777fcdaca',
                # 'secret': '804e02f2535f125cedd66e088c6de076',
                # 'secret': '92d5e54d4463adcbaa04f850e678c7b4',
                'secret': 'd1301bc2ecfc3f57316dd5e343e909ca',
                'verify_token': '0625B92F02E8FA92BDA84A7F5E4516C5',
            },
            # 'pay': {
            #     'mch_id': '1482961342',
            #     'mch_desc': '珠海海富思科技有限公司',
            #     'sign_key': 'Hifocus2017062610101062398280756',
            #     'sign_key_sandbox': '21df264c7957ea3c45c6a19f7f68dac3',
            #     'use_sandbox': True,
            # }
            'pay': {
                # 'mch_id': '1450485102',
                'mch_id': '1482961342',
                'mch_desc': '珠海海富思科技有限公司',
                # 'sign_key': 'Hifocus2017062610101062398280756',
                'sign_key': 'E504654B5B494704818C30AD91D0BBDE',
                'sign_key_sandbox': 'e7672e9bb7ab330cb30dcb98a80e6d73',
                'use_sandbox': False,
            }
        },

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能管家',
                'register_code': 'SMS_77775036',
                'reset_password_code': 'SMS_77765047',
                'change_phone_code': 'SMS_77630040',
            }
        },

        'use_alipay_sandbox': True,
        'alipay': {
            'appid': '2018081661050585',
            'rsa2': {
                'app_priv': 'MIIEogIBAAKCAQEAyLYIAY5+x6FqTe3qqM/gAzNF9v3Jvx0Q6Hiv9I3JrUICGxjCIFhCw6Z/g5KguXjU0cgzaTDqrSY5cgZ+Y5WUgX7H7W4Fl6/EyIosB2RMvRKZAPmIOrO5ne15OWnSuoZ1I66OzdiJXCEq3cL7e7Ke7r4y34Qo5sV+re51xxvYASy4OpibR7JhdwzsJVIO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9S4R7Fdb3qLaEv1uRvQIDAQAB',
            },
        },
        'alipay_sandbox': {
            'appid': '2016091700533981',
            'rsa2': {
                'app_pri': 'MIIEowIBAAKCAQEAxpH37RaTWxCKDreFTKgBGS4tbD5oS1eTSjPKOtlgXWv6RZyeuZW8ZaamfYU5o/BLBN1Ni0irMUT05xQuMlqzCzzhPy2ZuqKLPJExyUL91wZntZFF0Jn4kWpcLR8PBKpc2f24JjikXgID+x8R2DuKYKwBca4SYqXQuIL10RQJaFaS57jUeVxyo5KAQ1ReHyi+XcSO3wyDEn9MjlWCMaj9Zd/uBTxqFf/kyagbGrFsI+665Eqfe//nmBAldzrXzhg4+Sp5GRxyTKwmxnJChPhGU1+Db5ZwAVmZV6mjCTMX5/Mh2xGsUPXTFPbXdNJ0Ys/sKW/RhhtvUiZN6yIQYQYuxQIDAQABAoIBAHoI+Xq/Fh6wQnia9xROaCZmh8nvbL9o+f9vZsjWEXA4zR39DFt4F8nNKqMXvn3vTtuVenOwXG2yOGTPtTiDH2g3qSLfzouyG6pEfXl4b3K34ALpXiO+jNIpsK6WWO+AGAJs+MCcrP+Nc47g4GGo7flNnLGVznzL9UOAULyG+OUiwjFI4tYVtw0PCuNyqh2khAPIIl09vkCU0OT3HQ55YURIoFQ9o3UfOYrgxKuZI/TV0qiUdzk064Hm3cuQt1uBvJAWLJTesn8ymWTztCSpJICp/db4BYU8FkOY2/aWc5JNwu749DbLjPdUzkwrf5kkm5b1wDiwXd24F8mje5SoXsECgYEA7Zh5LnXoaP4AMXeCgZ1Qzftd7v59mTWB4xZZM1Qt0wT4R8FQsO27YgxGc6hIrFDmUJ0F1QGJ/hBfbea7ecS/hHGUtPRd3tIUX/OoXZrG1BsxZCOEUh3naK9j6RwGZSINwl5p+bW4W7o00OlIUIUgDKTlsU5thjiIM5KHcbu/3zECgYEA1fOeyLrlbXZsFu/I5vX53pKxVPNQZ9fY83cBt4Th3F+o59ji3w2ednWYUYSdKeFmF8ZwP4AfdB34BTm47Xh5VHxH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Ar+8J97inlGqRvtsG0h7MiXfx1kLEKEOlZNkNkkBYkrnVnHmd29IhhI3M9dL3UsA0w877cIzBi9BJmQLewXIaOFxAd+8xM8EVF+mhC8C+1F28WGZtV43ivIzKVXwV+rdyoPbDOxQbgSimnCPpK8wtJtQ+giFAARYUtLP51mgT4Og47v/jr00Wg4cKJ8o9DFDMqXzbfDYzbt/e/TN4HD54HjvQ7gQuEFiaVzaMks2omthhGlDeIfVOic+kaaX1gPwR24Y3lJfstmvnZcTyZR1/sNQif8vAytHk/xHpdputHzng0yjEDEfG3ZblJ7/oX+l0y6mH3dJQLQ4cu0SouoCOQQIDAQAB',
            },
        },
    },

    'FF2345ECD032D8D486502CB40A37736C': {
        'name': '[海富思智联 APP]',
        'desc': '[海富思智联 APP]',
        'app_id': 'FBA4E56280DA34E0C3697BEE37E1B04F',
        'secret': '45A5C489FDFF9F47438CA52613F650E3',

        'weixin': {
            'mp': {
                'app_id': 'wx4a3c00e777fcdaca',
                # 'secret': '804e02f2535f125cedd66e088c6de076',
                # 'secret': '92d5e54d4463adcbaa04f850e678c7b4',
                'secret': 'd1301bc2ecfc3f57316dd5e343e909ca',
                'verify_token': '0625B92F02E8FA92BDA84A7F5E4516C5',
            },
            # 'pay': {
            #     'mch_id': '1482961342',
            #     'mch_desc': '珠海海富思科技有限公司',
            #     'sign_key': 'Hifocus2017062610101062398280756',
            #     'sign_key_sandbox': '21df264c7957ea3c45c6a19f7f68dac3',
            #     'use_sandbox': True,
            # }
            'pay': {
                # 'mch_id': '1450485102',
                'mch_id': '1482961342',
                'mch_desc': '珠海海富思科技有限公司',
                # 'sign_key': 'Hifocus2017062610101062398280756',
                'sign_key': 'E504654B5B494704818C30AD91D0BBDE',
                'sign_key_sandbox': 'e7672e9bb7ab330cb30dcb98a80e6d73',
                'use_sandbox': False,
            }
        },

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能管家',
                'register_code': 'SMS_77775036',
                'reset_password_code': 'SMS_77765047',
                'change_phone_code': 'SMS_77630040',
            }
        }
    },
    '93F9C5720748E3F37F591D295EF61A8A': {
        'name': '东臣净水机',
        'desc': '东臣净水机',
        'app_id': '6194C5C4A27A0AFF0AED6F63A3C9B7DF',
        'secret': 'BDA151927F660117C32A04BE034ABC9E',

        'weixin': {
            'mp': {
                'app_id': 'wxb11ab75962406a47',
                'secret': '3eac306a144c57a698ed3a319718fee4',
                'verify_token': '45D2FE4556BB6CD24923FBF3AA76A23C',
            },
            'pay': {
                'mch_id': '1482961342',
                'mch_desc': '珠海海富思科技有限公司',
                'sign_key': 'Hifocus2017062610101062398280756',
                'sign_key_sandbox': '21df264c7957ea3c45c6a19f7f68dac3',
                'use_sandbox': True,
            }
        },

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能饮水机',
                'register_code': 'SMS_77870001',
                'reset_password_code': 'SMS_77700052',
                'change_phone_code': 'SMS_77760048',
            }
        }
    },

    "F65D35E18BF01D5D162C4294E8047CD4": {
        "app_id": "5DCF44D9866FD1EA8BED950EEB52FFBA",
        "secret": "D52E86FA6DB09583C1BB97C5F617F964",
        "name": "NDS",
        "desc": "for new distribution system",

        "alidayu": {
            "appkey": "23749569",
            "secret": "47fdda3390d660126278322e36a39cc4",
            "sms": {
                "register_code": "SMS_77870001",
                "sign_name": "智能饮水机",
                "change_phone_code": "SMS_77760048",
                "reset_password_code": "SMS_77700052"
            }
        },
        "weixin": {
            "pay": {
                "mch_id": "pending..",
                "sign_key": "pending..",
                "mch_desc": "pending..",
                "sign_key_sandbox": "pending..",
                "ca_certs": "certs/dgk/rootca.pem",
                "use_sandbox": False,
                "client_cert": "certs/dgk/wx/pay/apiclient_cert.pem",
                "client_key": "certs/dgk/wx/pay/apiclient_key.pem"
            },
            "mp": {
                "secret": "pending..",
                "app_id": "pending..",
                "verify_token": "pending..."
            }
        },
        "specifics": {},
        "allinpay": {
            "mer_id": "pending..",
            "rsa_pri_key": "certs/dgk/allinpay/private.pem",
            "rsa_pub_key": "certs/dgk/allinpay/public.pem",
            "app_key": "pending.."
        },
    },

    'CF859FF521D73AA88EAD95197BC26420': {
        'name': 'DGK智能平台',
        'desc': 'DGK智能平台',
        'app_id': '120FFFC42C26B484EBD28DD9263B3581',
        'secret': '99D7C90B8AD41020B504607F11C5B461',

        # 'register_require_auth_code': True,
        # 'register_require_spreader': True,

        'weixin': {
            'mp': {
                'app_id': 'wx4bca33369c311b36',
                'secret': 'b7ca760ecf0edbc81512dbf2a7325dfd',
                'verify_token': '45D2FE4556BB6CD24923FBF3AA76A23C',
            },
            'pay': {
                'mch_id': '1488791892',
                'mch_desc': '广东顺德迪吉凯电子商务有限公司',
                'sign_key': '9B1F0CA03FA54eafBF131F2299839EBD',
                'sign_key_sandbox': '8e94ea9487e155589e731d0856580dfb',
                'use_sandbox': False,

                'ca_certs': 'certs/dgk/rootca.pem',
                'client_cert': 'certs/dgk/wx/pay/apiclient_cert.pem',
                'client_key': 'certs/dgk/wx/pay/apiclient_key.pem',
            }
        },

        'allinpay': {
            # 分期 Installment
            'app_key': 'dckj',
            'mer_id': '999603050650001',
            # 'rsa_pub_key': 'certs/dgk/allinpay/public.pem',
            'rsa_pub_key': 'certs/dgk/allinpay/public_srv.pem',
            'rsa_pri_key': 'certs/dgk/allinpay/private.pem',
            # 提现
            'transfer': {
                'mer_id': '200603000001374',
                'username': '20060300000137404',
                'password': '111111',
                'rsa_pub_key': 'certs/dgk/allinpay/transfer/public_srv.pem',
                'rsa_pri_key': 'certs/dgk/allinpay/transfer/private.pem',
            },
        },

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能饮水机',
                'register_code': 'SMS_77870001',
                'reset_password_code': 'SMS_77700052',
                'change_phone_code': 'SMS_77760048',
            }
        }
    },

    '8D518099B576C8AAD5B094E762B17716': {
        'name': '斯帝沃集团',
        'desc': '斯帝沃集团',
        'app_id': '89CF7BCE962A89EA77FE56EC7CA7A2FF',
        'secret': '9B5C4C0969E0E63D59EF20CA70F8223E',

        'weixin': {
            'mp': {
                'app_id': 'wxa979ac87742efd30',
                'secret': 'ee93d474975ba94687ea3491ae8cd3c4',
                'verify_token': '00B88D47812E3C438953B48F980C0EC3',
            },
            'pay': {
                'mch_id': '1480183932',
                'mch_desc': '斯帝沃集团',
                'sign_key': '89CF7BCE962A89EA77FE56EC7CA7A2FF',
                'sign_key_sandbox': '8e94ea9487e155589e731d0856580dfb',
                'use_sandbox': False,

                'ca_certs': 'certs/dgk/rootca.pem',
                'client_cert': 'certs/dgk/wx/pay/apiclient_cert.pem',
                'client_key': 'certs/dgk/wx/pay/apiclient_key.pem',
            }
        },

        'allinpay': {
            'app_key': 'dckj',
            'mer_id': '999603050650001',
            'rsa_pub_key': 'certs/dgk/allinpay/public.pem',
            'rsa_pri_key': 'certs/dgk/allinpay/private.pem',
        },

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能饮水机',
                'register_code': 'SMS_77870001',
                'reset_password_code': 'SMS_77700052',
                'change_phone_code': 'SMS_77760048',
            }
        },
        # 与具体应用相关的配置
        'specifics': {
            # 奖励金统计时间(每月6日)
        },
    },

    '4ED7DE46528591A50B0BF3E8A1BAE41F': {
        'name': '金立净水机',
        'desc': '金立净水机',
        'app_id': '1D5AC34D4DC90FA320256B8797E7017C',
        'secret': 'ADA98DB9253A4763CEB768CC7604A966',

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能饮水机',
                'register_code': 'SMS_77870001',
                'reset_password_code': 'SMS_77700052',
                'change_phone_code': 'SMS_77760048',
            }
        }
    },
    '2D88735656AED8093B428FA17E925C19': {
        'name': '麦诗特净水机',
        'desc': '麦诗特净水机',
        'app_id': '5E5C5B33DAEE68FA5EFF9041F4A3D71F',
        'secret': '648BB7DAE8CAE57B72A81ADECFFEBBF6',

        'weixin': {
            'mp': {
                'app_id': 'wx471c301aa39aa2d6',
                'secret': '82a8c98853f1f55ec9e795c751adf80d',
                'verify_token': 'C5AB802C32E8B48730DFDA75E62E15BD',
            },
            'pay': {

            }
        },

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能饮水机',
                'register_code': 'SMS_77870001',
                'reset_password_code': 'SMS_77700052',
                'change_phone_code': 'SMS_77760048',
            }
        }
    },
    'FF9606D3B2ED3B0E6F6A3A05FE466974': {
        'name': '罕萨冰川净水机',
        'desc': '罕萨冰川净水机',
        'app_id': '9B57510D469411CFE8E4938EA7BCF0A5',
        'secret': '320C5CB056CB257B1A95F9EF9D65F463',

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能饮水机',
                'register_code': 'SMS_77870001',
                'reset_password_code': 'SMS_77700052',
                'change_phone_code': 'SMS_77760048',
            }
        }
    },
    'C6109CC943CF38F62CBA4EFE2A8C80E1': {
        'name': '智能门禁',
        'desc': '海富思门禁住户 APP',
        'app_id': '90C58930B4D5F1ACCBD9DAB6008FFB3D',
        'secret': '08280E5C89F8607FAA01C83A0C3CAB6C',

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能管家',
                'register_code': 'SMS_77775036',
                'reset_password_code': 'SMS_77765047',
                'change_phone_code': 'SMS_77630040',
            }
        }
    },
    'E61A9CB412EDC8CBEAFC28C7E65B43C7': {
        'name': '智能门禁',
        'desc': '海富思门禁小区管理员 APP',
        'app_id': '84B4FE95EC21C9B907F6817F089C3D22',
        'secret': '2A66E7A1196F2164D9A57C2B050D1987',

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能管家',
                'register_code': 'SMS_77775036',
                'reset_password_code': 'SMS_77765047',
                'change_phone_code': 'SMS_77630040',
            }
        }
    },

    '432AEDC1FE4F01878AFC43A0CB78D971': {
        'name': '智能门禁',
        'desc': '海富思门禁平台管理员 APP',
        'app_id': '733C5F0D05C43E93C288DF970CC3603F',
        'secret': '97976BCE6C8DF7ABEF24F95BE7181D35',

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能管家',
                'register_code': 'SMS_77775036',
                'reset_password_code': 'SMS_77765047',
                'change_phone_code': 'SMS_77630040',
            }
        }
    },

    '06728319D0A8C8CBE8DFE959D0DE5179': {
        'name': '智能插座',
        'desc': '海富思PLC智能插座',
        'app_id': 'D2D7E9B2BA99527F1B851516755D8938',
        'secret': 'E64853E0425D4FB957A52EEFFF7A2CB7',

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能管家',
                'register_code': 'SMS_77775036',
                'reset_password_code': 'SMS_77765047',
                'change_phone_code': 'SMS_77630040',
            }
        }
    },
    '097E45E0EC5A69D429840D01D4239838': {
        'name': '好的水净水机',
        'desc': '深圳市好的水科技有限公司',
        'app_id': '0D471E553C0A8D041288F77394B8FFE3',
        'secret': '4117A0B8F46E45AFD19A615127A6C825',

        'weixin': {
            'mp': {
                'app_id': 'wx0be83697a829ab7b',
                'secret': 'cc572b6c8687ebb48a3ca483c279dd32',
                'verify_token': '54B32773FAA9051A734C6D0A92CA7911',
            },
            'pay': {

            }
        },

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能饮水机',
                'register_code': 'SMS_77870001',
                'reset_password_code': 'SMS_77700052',
                'change_phone_code': 'SMS_77760048',
            }
        }
    },

    # 设备
    'C3438E38A9FC94820774B279BE25E144': {
        'name': '净水机设备',
        'desc': '净水机设备',
        'app_id': '2BD6B7FCA796DE8B3A0EF04AA1A6F827',
        'secret': '155A20FD452372095C5E16D4307A7886',
    },
    'B35932771043E2BC65704C7D60BCDA0B': {
        'name': '门禁设备',
        'desc': '门禁设备',
        'app_id': '5A752BC91727414FF1C824B8694F17E5',
        'secret': '3BDB70173FE65718A1712E9E4742BC41',
    },
    '4CE923F1C6C0B2D53EDA800CE79BE566': {
        'name': '智能插座设备',
        'desc': '智能插座设备',
        'app_id': 'B6165756C716C863FECEA4E232D9E72B',
        'secret': '29B370316E10AF874945A1C9F485A1C3',
    },

    # WEB
    'EFC71129CB649FF3304D595B431EB6EF': {
        'name': '小区门禁管理员平台',
        'desc': '小区门禁管理员平台',
        'app_id': 'F8253F0444F7EA815CE62B6392824ABB',
        'secret': '7EE175C539990588F65A6A202D1C67D3',

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能管家',
                'register_code': 'SMS_77775036',
                'reset_password_code': 'SMS_77765047',
                'change_phone_code': 'SMS_77630040',
            }
        }
    },
    '4296707B5C045AC22E6AC51FD63AB83C': {
        'name': '智能饮水机管理平台',
        'desc': '智能饮水机管理平台',
        'app_id': '92F37C7378E32E1331B72421A939DB15',
        'secret': '2AC8D962A6A1B69722DFB97421E52A3E',

        'alidayu': {
            'appkey': '23749569',
            'secret': '47fdda3390d660126278322e36a39cc4',
            'sms': {
                'sign_name': '智能饮水机',
                'register_code': 'SMS_77870001',
                'reset_password_code': 'SMS_77700052',
                'change_phone_code': 'SMS_77760048',
            }
        }
    }
}

from delegates.hfs.dgk.dgk_users_delegate import DgkUsersDelegate
from delegates.hfs.dgk.dgk_devices_delegate import DgkDevicesDelegate
from delegates.hfs.dgk.dgk_products_delegate import DgkProductsDelegate
from delegates.hfs.dgk.dgk_orders_delegate import DgkOrdersDelegate

from delegates.hfs.nds.users_delegate import NdsUsersDelegate
from delegates.hfs.nds.devices_delegate import NdsDevicesDelegate
from delegates.hfs.nds.products_delegate import NdsProductsDelegate
from delegates.hfs.nds.orders_delegate import NdsOrdersDelegate

dgk_delegates = {
    'users': DgkUsersDelegate,
    'devices': DgkDevicesDelegate,
    'products': DgkProductsDelegate,
    'orders': DgkOrdersDelegate,
}

nds_delegates = {
    'users': NdsUsersDelegate,
    'devices': NdsDevicesDelegate,
    'products': NdsProductsDelegate,
    'orders': NdsOrdersDelegate,
}

common_delegates = {
    'devices': NdsDevicesDelegate,
}

sdw_delegates = dgk_delegates
test_delegates = dgk_delegates

DELEGATES = {
    # DGK
    'CF859FF521D73AA88EAD95197BC26420': dgk_delegates,
    # SDW
    '8D518099B576C8AAD5B094E762B17716': sdw_delegates,
    # test
    'CA7E0BE302DF22F9CF4315BDCF66B62D': test_delegates,
    # for new distribution system
    'F65D35E18BF01D5D162C4294E8047CD4': nds_delegates,
    'ED1345ECD032D8D486502CB40A37736C': nds_delegates,
    '*': common_delegates,
}

TOP = {
    'gateway': 'http://gw.api.taobao.com/router/rest',
    'alidayu': {
        # for test
        # 'appkey': '23749941',
        # 'secret': '2b8832439943ba33bb8a85e92ad13e01',
        # for release
        'appkey': '23749569',
        'secret': '47fdda3390d660126278322e36a39cc4',
        # 'product': '智能净水机',
        # 'appkey': '23745790',
        # 'secret': '097c2b6f08ac9b1a4dfc773f404942c5',
        # 'appkey': '23705245',
        # 'secret': 'b1bda42d7b7c50f54cd6072db1c95217',
        'sms': {
            'register_code': {
                'sign_name': '智能管家',
                'temp_code': 'SMS_77775036',
                # 'sign_name': '注册验证',
                # 'temp_code': 'SMS_56995084',
                # 'expire_in': 60 * 15,
                # 'send_interval': 60,
                # 'send_cycle': 3600,
                # 'max_send_count': 7,
            },
            'reset_password_code': {
                'sign_name': '智能管家',
                'temp_code': 'SMS_77765047',
                # 'sign_name': '身份验证',
                # 'temp_code': 'SMS_56995081',
                # 'expire_in': 60 * 15,
                # 'send_interval': 60,
                # 'send_cycle': 3600 * 24,
                # 'max_send_count': 50,
            },
            'change_phone_code': {
                'sign_name': '智能管家',
                'temp_code': 'SMS_77630040',
                # 'sign_name': '变更验证',
                # 'temp_code': 'SMS_56995081',
            }
        }
    }
}

root_user_id = '5a587904d823ef4e582422e4'
root_role_id = '5a587776d823ef4e582422de'
root_role = {
    'role_id': root_role_id,
    'name': 'root',
}
root_role_subordinates = {
    '5a588462d823ef7c851c6ecf': {
        'role_id': '5a588462d823ef7c851c6ecf',
        'name': 'vendor',
        'superior_id': root_role_id,
    },
}

'''
签名：智能饮水机
智能水机用户注册 - SMS_77870001
智能水机用户密码找回 - SMS_77700052
智能水机用户资料修改 - SMS_77760048
'''

APP_TEMP = {
    'appkey': '',
    'name': 'pending...',
    'desc': 'pending...',
    'app_id': 'pending...',
    'secret': 'pending...',

    'weixin': {
        'mp': {
            'app_id': 'pending..',
            'secret': 'pending..',
            'verify_token': 'pending...',
        },
        'pay': {
            'mch_id': 'pending..',
            'mch_desc': 'pending..',
            'sign_key': 'pending..',
            'sign_key_sandbox': 'pending..',
            'use_sandbox': False,

            'ca_certs': 'certs/dgk/rootca.pem',
            'client_cert': 'certs/dgk/wx/pay/apiclient_cert.pem',
            'client_key': 'certs/dgk/wx/pay/apiclient_key.pem',
        }
    },

    'allinpay': {
        'app_key': 'pending..',
        'mer_id': 'pending..',
        'rsa_pub_key': 'certs/dgk/allinpay/public.pem',
        'rsa_pri_key': 'certs/dgk/allinpay/private.pem',
    },

    'alidayu': {
        'appkey': '23749569',
        'secret': '47fdda3390d660126278322e36a39cc4',
        'sms': {
            'sign_name': '智能饮水机',
            'register_code': 'SMS_77870001',
            'reset_password_code': 'SMS_77700052',
            'change_phone_code': 'SMS_77760048',
        }
    },
    # 与具体应用相关的配置
    'specifics': {
        # 奖励金统计时间(每月6日)
    },
}


def get_md5_hexdigest():
    import uuid
    import hashlib
    return hashlib.md5(str(uuid.uuid4())).hexdigest().upper()


def format_obj(obj):
    import json
    # return json.dumps(obj, ensure_ascii=False, indent=4).encode('utf-8')
    return json.dumps(obj, indent=4, ensure_ascii=False)


def print_obj(obj):
    print format_obj(obj)


def gen_new_app():
    APP_TEMP['appkey'] = get_md5_hexdigest()
    APP_TEMP['app_id'] = get_md5_hexdigest()
    APP_TEMP['secret'] = get_md5_hexdigest()
    print_obj(APP_TEMP)


def get_app_list():
    import copy
    result = []
    for k, v in APPS.iteritems():
        if '403DB206089258FBB529B861AB768D59' == k:
            continue
        out = copy.copy(v)
        out.pop('app_id')
        out['appkey'] = k
        result.append(out)
    return format_obj(result)


if '__main__' == __name__:
    # print get_app_list()
    gen_new_app()
